All right, let's add sound and damage to our boulder on our boulder.
So in order to get sound the easiest way, go to the toolbox.
Go to Marketplace, this first tab under where it says models.
You can go and click on that and then you can see audio and then you could search for different audio
in the toolbox.
I did that.
It took me a really long time and I thought, you know what, I'm just going to save one of these sounds
off so they don't have to suffer.
And I've put it open up your web browser.
On Roblox.
Here's the link.
I'll put it that in the description.
Click on it.
It'll open this page.
This will be green.
It'll say get.
You press it, go to Roblox studio, go to inventory, and then you will get the boulder sound.
Right.
Get the boulder sound.
I'm going to just drag it into my workspace here.
There it is popped up into the workspace, but we need to put it on.
We need to put it in the boulder trap on the boulder.
Just drag that boom boulder.
So if a sound is on a part, is on a part or an attachment in your workspace, as it gets further away,
it's going to start to attenuate.
It's going to get less like like in real life, when sound is further away, it gets less and less and
less.
So that is good.
Let's take a look at our a few of our properties on the Boulder sound.
We could preview it.
Cool.
It'll keep plan.
I just hit the stop.
It'll keep playing because I saved it off as looped.
So if you find your own in the toolbox and you want it to run, as long as the boulders are going loop
does the easiest way.
And then let's take a look down here.
Volume.
It was at 0.5.
I changed it to two to make it loud, right?
It's going to be kind of an event.
So I made it.
I made it four times the sound in volume.
And it also we have roll off max distance.
That's the maximum distance you could be away from the sound and still hear it.
It's really big.
It's at 10,000 studs.
That's all right because this is a big event so we can make it roll far.
The roll off min distance is how far you have to be away before you start hearing some attenuation of
the sound.
Right?
The roll off mode inverse is very much like real life.
They try to mimic real life as it gets further how the sound is going to change.
But you also have a few other options that you can play with.
All right.
I'm not going to go over them.
You can play around with them.
See what you like.
All right.
Let's go ahead and add this sound to our code so that it fires when our when our boulder starts rolling.
So trigger, it actually makes the boulder roll.
So this is where we're going to put our sound.
It's going to be one line of code.
On touch.
When we touch our trigger plate, the bolder is released.
We can put the sound right here.
Right.
So Kerr Boulder is the clone of our boulder.
We'll say Dot.
Boulder sound.
Colon So this is a method that we're going to play, right?
So we're going to play the bolder sound.
That's it.
We can go ahead and play this and we're going to hear that play.
So we already have looped set, though, right?
Because I hit it in the properties.
There comes.
That's pretty cool.
Yeah, that's not bad.
I'm not astounded.
Engineer for sure.
So a lot of you guys probably do better, but it gets you up and running, right?
Let's go and put some damage on that so that when it hits, it hits us.
It kills us.
Hit the stop and let's go to our boulder.
I'm going to put the damage script on the boulder because it's only going to have to do with the boulder
and what the boulder touches, which is going to be us or zombies.
Hit the plus sign on the Boulder script.
Let's call it damage
Damage.
Now go ahead and get a variable for our Boulder Local Boulder equals script dot parent.
Cool.
And then we'll get a function for our on Touch event for the boulder on touch.
Other part, this is much like our healing potion or our little healing pickup.
We need to get the boulder's touched event connected to on touch.
Right?
Make sure there's no little extra parentheses in there.
Just just the name.
Just the name of the function.
If the other part is a character, it might be his head or his torso.
We're going to try and get the humanoid from that.
So other part, let's say it's the head.
If it's the head, the parent is the character and the character.
We can do a find first child.
That's a humanoid.
Ooh, don't spell it wrong.
Humanoid.
I did spell it wrong.
You won't get an error if you spell this wrong, it just won't find it.
And then you'll be wondering why it's not working.
Right.
That's a tough one.
So I'll say if human, then let's say the humanoid exists.
We're going to say human colon, take damage and we'll just make it 20 points.
So it's going to hit us many times.
We don't have a DB out, so it might hit our arm and our head and our torso a lot of different places.
So we only have 100 points to deal with.
It's probably going to kill us.
It's fine because it's a boulder, right?
So it's not unusual for Boulder to kill somebody.
Let's go ahead and try it out.
We got to we got to wait for a little invincibility bubble to go away or we won't get hurt from the
boulder.
There you go.
That's pretty cool, right?
And then we respond.
All right.
Next one, we're going to do badges.